import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {TabsPage} from './tabs.page';

const routes: Routes = [
    {
        path: 'tabs',
        component: TabsPage,
        children: [
            {
                path: 'start',
                children: [
                    {
                        path: '',
                        loadChildren: () =>
                            import('../start/start.module').then(m => m.StartPageModule)
                    }
                ]
            },
            {
                path: 'customer-need',
                children: [
                    {
                        path: '',
                        loadChildren: () =>
                            import('../customer-need/customer-need.module').then(m => m.CustomerNeedPageModule)
                    }
                ]
            },
            {
                path: 'need',
                children: [
                    {
                        path: '',
                        loadChildren: () =>
                            import('../need/need.module').then(m => m.NeedPageModule)
                    }
                ]
            },
            {
                path: 'data',
                children: [
                    {
                        path: '',
                        loadChildren: () =>
                            import('../data/data.module').then(m => m.DataPageModule)
                    }
                ]
            },
            {
                path: 'my',
                children: [
                    {
                        path: '',
                        loadChildren: () =>
                            import('../my/my.module').then(m => m.MyPageModule)
                    }
                ]
            },
            {
                path: '',
                redirectTo: '/tabs/start',
                pathMatch: 'full'
            }
        ]
    },
    {
        path: '',
        redirectTo: '/tabs/start',
        pathMatch: 'full'
    },
    {
        path: 'tabs/start/start-new',
        loadChildren: () => import('../start/start-new/start-new.module').then(m => m.StartNewPageModule)
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class TabsPageRoutingModule {
}
